package com.shujia.java.day8.demo;

// 被继承的类 叫做父类  通过继承的方式 进行代码重用
public class Animals {
    String name;//姓名
    private int age;//年龄
    private String color;
    public Animals() {
    }

    public Animals(String name, int age, String color) {
        this.name = name;
        this.age = age;
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

     Animals test(){
        Animals animals = new Animals();
        return animals;
    }
    // 吃
    public void eat(){
    }
    //睡觉
    public void sleep(){
    }
    //重载 参数不同 方法名相同 反回值类型无影响 当前类 访问修饰符无影响
    private int sleep(String name){
        return 0;
    }
}
